<%--
  Created by IntelliJ IDEA.
  User: Leven Han
  Date: 2022/10/12
  Time: 0:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login</title>
</head>
<body>
    <form action="/study_01/loginServlet" method="post">
        <table>
            <tr>
                <td>用户名</td>
                <td><input  name="username"/></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" name="password"/></td>
            </tr>
            <tr><td style="color: red"><%=request.getAttribute("loginError")!=null?request.getAttribute("loginError"):""%></td></tr>

            <tr>
                <td>验证码</td>
                <td><input  name="checkCode"/></td>
            </tr>
             <tr><td style="color: red"><%=request.getAttribute("checkCodeError")!=null?request.getAttribute("checkCodeError"):""%></td></tr>
            <tr>
                <td colspan="2"><img id="img" src="/study_01/checkCode"></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit"  value="登录"/></td>
            </tr>
        </table>
    </form>
</body>
<script>
    document.getElementById("img").onclick=function () {
        this.src = "/study_01/checkCode?t="+new Date().getTime()
    }
</script>
</html>
